package com.suyuan.service.impl;

import com.suyuan.dao.AreacodeinforMapper;
import com.suyuan.entity.Areacodeinfor;
import com.suyuan.entity.AreacodeinforExample;
import com.suyuan.service.AreaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 区域业务层实现类
 */
@Service("areaService")
public class AreaServiceImpl implements AreaService {


    @Resource
    private AreacodeinforMapper areacodeinforMapper;


    /**
     * 根据公司查询其区域ID
     * @param compID
     * @return
     */
    public List<Areacodeinfor> findAreaByCompID(Integer compID) {
        if(compID == null || compID ==0){
            return null;
        }
        AreacodeinforExample areacodeinforExample = new AreacodeinforExample();
        AreacodeinforExample.Criteria criteria = areacodeinforExample.createCriteria();
        criteria.andCompidEqualTo(compID);

         return   areacodeinforMapper.selectByExample(areacodeinforExample);
    }

}
